home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD008b.dsk
/
HORSE.RACE.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
7KB
|
198 lines
1 GOSUB 5009
3 HOME
5 PRINT "THERE ARE 8 HORSES IN THIS RACE"
10 PRINT : PRINT "MORE THAN ONE PLAYER CAN BET ON A HORSE,BUT ONLY ONE BET PER PLAYER"
15 PRINT : PRINT "THE HORSES GO DOWN THE TRACK TWO TIMES. WINNER IS THE FIRST HORSE CROSSING THE FINISH LINE AFTER THE SECOND TIME"
16 ONERR GOTO 18
18 PRINT : INPUT "DO YOU WISH TO USE PREVIOUSLY SAVED BANKROLL WITH SAME PLAYERS? ";A$: IF LEFT$(A$,1) = "Y" THEN 4100
19 IF LEFT$(A$,1) < >"N" THEN 18
20 VTAB (15): PRINT "HOW MANY PLAYERS? ";: HTAB 19: INPUT P
25 IF P >10 THEN VTAB 13: PRINT " LIMIT OF 10 PLAYERS": GOTO 20
30 G = 1000: PRINT : PRINT "EACH PLAYER HAS A BANKROLL OF $1000"
40 GOSUB 5000: PRINT
55 L = 200: PRINT : PRINT "THE LIMIT FOR EACH BET IS $200"
60 FOR I = 1 TO 8: READ A$(I): NEXT
70 DATA SEABISCUIT, CITATION, SECRETARIAT,WAR ADMIRAL, MAN O'WAR, SEATTLE SLEW,TWENTY GRAND, AFFIRMED
105 VTAB (23)
110 FOR I = 1 TO P: PRINT "WHAT IS NAME OF PLAYER NUMBER ";I;"?": INPUT N$(I): PRINT : NEXT
115 FOR I = 1 TO 8:O(I) = INT(19 * RND(1)) +2: NEXT
135 GOTO 590
201 GR
202 COLOR= 12
203 FOR I = 0 TO 35
204 VLIN 5,21 AT I
205 NEXT I
220 COLOR= 9
230 HLIN 0,36 AT 4
240 HLIN 0,36 AT 22
250 VLIN 4,22 AT 36
260 FOR I = 1 TO 8:X(I) = 0: NEXT
270 Z1 = 36:Y1 = 36:W1 = 36
290 Y = 6:Z = 1: FOR I = 1 TO 8
310 COLOR= Z: PLOT X(I),Y
330 Y = Y +2:Z = Z +2: NEXT I
331 GOSUB 575
332 PRINT : PRINT : PRINT
333 VTAB (23): PRINT TAB( 15)"THEY'RE OFF": GOSUB 576
335 T2 = 0
340 T2 = T2 +1
350 Z = 1:Y = 6
355 PRINT : PRINT : PRINT
360 FOR I = 1 TO 8
365 COLOR= Z
370 S = ( INT(2 * RND(1)) +1) *HD(I): IF S >2 THEN S = 2
380 C(I) = X(I) +S
390 PLOT C(I),Y
400 COLOR= 12
410 PLOT X(I),Y:Y = Y +2
420 X(I) = C(I)
422 IF T2 >35 THEN GOTO 428
425 IF X(I) >35 THEN X(I) = 0
428 COLOR= 0
429 VLIN 4,22 AT 37
430 COLOR= 9
432 VLIN 4,22 AT 36
435 IF X(I) >Z1 THEN 1500
436 IF X(I) >Y1 THEN 1520
437 IF X(I) >W1 THEN 1530
440 Z = Z +2
445 NEXT I
446 GOTO 1200
450 GOTO 340
460 VTAB (22): PRINT "THE WINNER IS NO.";I;"-";A$(I): GOSUB 575
461 GOTO 445
462 VTAB (23): PRINT "SECOND PLACE IS NO ";I;"-";A$(I): GOSUB 575
463 GOTO 445
464 VTAB (24): PRINT "THIRD PLACE IS NO. ";I;"-";A$(I): GOSUB 575
465 TEXT : HOME : GOTO 799
575 FOR J = 1 TO 3000: NEXT : RETURN
576 FOR J = 1 TO 1000: NEXT : RETURN
577 FOR J = 1 TO 20: NEXT : RETURN
590 I = 0
600 I = I +1: GOSUB 3000
610 PRINT : PRINT : PRINT N$(I);", WHICH HORSE DO YOU WANT? (ENTER THE NUMBER OF THE HORSE)": INPUT H(I)
615 IF H(I) <1 OR H(I) >8 THEN 610
620 PRINT : INPUT "AMOUNT OF BET ";A(I)
625 IF A(I) <1 THEN 620
630 IF A(I) < = L THEN 650
640 PRINT : PRINT "OVER LIMIT. BET AGAIN": GOTO 620
650 PRINT : INPUT "IS YOUR BET FOR WIN, PLACE OR SHOW?? ";B$(I)
652 IF LEFT$(B$(I),1) = "W" THEN 660
653 IF LEFT$(B$(I),1) = "P" THEN 660
654 IF LEFT$(B$(I),1) = "S" THEN 660
655 GOTO 650
660 E = H(I)
670 O(E) = O(E) - INT(O(E) *A(I)/500): IF O(E) <2 THEN O(E) = 2
680 IF I <P THEN 600
685 HOME : PRINT "HERE ARE THE FINAL ODDS": GOSUB 3010
687 PRINT : PRINT
688 PRINT "PRESS ANY KEY TO START RACE": GET V3$
690 HOME : VTAB 23: PRINT "THE HORSES ARE AT THE STARTING GATE": GOSUB 575
710 GOTO 201
799 I = 0
800 I = I +1
810 IF H(I) = Z2 THEN 900
820 IF H(I) = Y2 THEN 910
830 IF H(I) = W2 THEN 920
835 SPEED= 150
840 PRINT N$(I);", SORRY, YOU DIDN'T WIN ON THIS RACE. YOUR LOSSES ARE $";A(I)
850 T3(I) = T3(I) -A(I)
860 PRINT "YOUR BANKROLL IS NOW $";T3(I)
865 SPEED= 255
870 IF I = P THEN 1400
880 GOTO 800
900 IF A(I) >0 THEN 1100
910 IF A(I) >0 THEN 1110
920 IF A(I) >0 THEN 1120
1100 IF LEFT$(B$(I),1) = "W" THEN 1300
1110 IF LEFT$(B$(I),1) = "P" THEN 1330
1120 IF LEFT$(B$(I),1) = "S" THEN 1360
1130 GOTO 840
1200 Z = 15:Y = 20
1202 T2 = T2 +1
1205 FOR I = 8 TO 1 STEP -1
1220 COLOR= Z
1230 S = ( INT(2 * RND(1)) +1)
1240 C(I) = X(I) +S
1250 PLOT C(I),Y
1258 COLOR= 12
1260 PLOT X(I),Y:Y = Y -2:X(I) = C(I)
1262 IF T2 >35 THEN GOTO 1266
1265 IF X(I) >35 THEN X(I) = 0
1266 COLOR= 0
1267 VLIN 4,22 AT 37
1268 COLOR= 9
1269 VLIN 4,22 AT 36
1270 IF X(I) >Z1 THEN GOTO 1500
1271 IF X(I) >Y1 THEN 1520
1272 IF X(I) >W1 THEN 1530
1280 Z = Z -2: NEXT I
1290 GOTO 340
1300 T(I) = A(I) *O(Z2): SPEED= 150
1310 PRINT : PRINT N$(I);", YOU WIN $";T(I);" FOR YOUR 1ST PLACE BET":T3(I) = T3(I) +T(I): GOTO 1380
1330 S(I) = INT(A(I) *O(Y2) *.6)
1340 PRINT : PRINT N$(I);", YOU WIN $";S(I);" FOR YOUR 'PLACE' BET":T3(I) = T3(I) +S(I): GOTO 1380
1360 V(I) = INT(A(I) *O(W2) *.3)
1370 PRINT : PRINT N$(I);" , YOU WIN $";V(I);" FOR YOUR 'SHOW' BET":T3(I) = T3(I) +V(I)
1380 PRINT " YOUR BANKROLL IS NOW $";T3(I): PRINT
1381 SPEED= 255
1385 IF I = P THEN 1400
1390 GOTO 800
1400 PRINT : INPUT "DO YOU WANT ANOTHER RACE? (YES/NO)";Y$
1410 IF LEFT$(Y$,1) = "Y" THEN 115
1411 IF LEFT$(Y$,1) < >"N" THEN 1410
1412 HOME
1414 VTAB 5: PRINT "DO YOU WANT TO SAVE THE PLAYERS' NAMES AND BANKROLLS FOR LATER USE? (Y/N) ": INPUT S$
1415 HOME
1416 IF LEFT$(S$,1) = "Y" THEN 4000
1418 IF LEFT$(S$,1) < >"N" THEN 1414
1420 PRINT : PRINT "THANKS FOR PLAYING HORSE RACE. HERE ARE FINAL BANKROLLS."
1425 SPEED= 150
1430 FOR I = 1 TO P: HTAB 15: PRINT N$(I);: HTAB 30: PRINT T3(I): PRINT : NEXT
1432 VTAB 20: PRINT "PRESS A KEY TO CONTINUE ": GET G$
1435 SPEED= 255
1436 IF SA = 1 THEN RETURN
1440 HOME : PRINT " THE END": END
1500 Z1 = 45:Z2 = I:X(I) = 0: GOTO 460
1520 Y1 = 45:Y2 = I:X(I) = 0: GOTO 462
1530 W1 = 45:W2 = I:X(I) = 0: GOTO 464
3000 HOME : PRINT "THE HORSES AND THEIR ODDS ARE ----"
3010 FOR J = 1 TO 8: PRINT
3020 PRINT "NO. ";J;" ";A$(J); TAB( 25);O(J);"/1":HD(J) = INT(20/O(J))
3025 IF HD(J) >2 THEN HD(J) = 2
3030 NEXT : RETURN
4000 PRINT CHR$(4);"OPEN HRSAVE"
4010 PRINT CHR$(4);"WRITE HRSAVE"
4015 PRINT P
4020 FOR I = 1 TO P
4030 PRINT N$(I): PRINT T3(I): NEXT
4040 PRINT CHR$(4);"CLOSE HRSAVE"
4050 GOTO 1420
4100 PRINT CHR$(4);"OPEN HRSAVE"
4110 PRINT CHR$(4);"READ HRSAVE"
4115 INPUT P
4120 FOR I = 1 TO P
4130 INPUT N$(I): INPUT T3(I): NEXT
4140 PRINT CHR$(4);"CLOSE HRSAVE"
4145 POKE 216,0
4150 HOME : PRINT : PRINT "HERE ARE YOUR BANKROLLS FROM LAST TIME": PRINT
4160 FOR I = 1 TO P: HTAB 15: PRINT N$(I);: HTAB (30): PRINT T3(I): PRINT : NEXT
4165 L = 200: PRINT : PRINT "THE LIMIT FOR EACH BET IS $200"
4170 VTAB 20: PRINT "PRESS A KEY TO CONTINUE ": GET G$
4190 FOR I = 1 TO 8: READ A$(I): NEXT
4200 GOTO 115
5000 FOR I = 1 TO P:T3(I) = G: NEXT : RETURN
5009 TEXT : HOME
5010 PRINT "****************************************";
5011 PRINT "** **";
5012 PRINT "** H O R S E R A C E **";
5013 PRINT "** **";
5014 PRINT "** WRITTEN BY JACK WILCOX **";
5015 PRINT "** LAFAYETTE, CA **";
5016 PRINT "** JUNE 1980 **";
5017 PRINT "** **";
5018 PRINT "** IN APPLESOFT **";
5019 PRINT "** **";
5020 PRINT "****************************************";
5021 VTAB 23: HTAB 10: PRINT "PRESS ANY KEY TO BEGIN": GET C$
5030 RETURN